/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.cashmate.struts;

import com.cashmate.hibernate.dao.RequirementDAO;
import com.cashmate.hibernate.pojo.Requirements;
import com.opensymphony.xwork2.ActionSupport;
import java.util.List;
import org.apache.log4j.Logger;
import org.apache.struts2.ServletActionContext;
import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.ParentPackage;
import org.apache.struts2.convention.annotation.Result;

/**
 *
 * @author Dine
 */

public class GetRequirements extends ActionSupport {

    private static Logger logger = Logger.getLogger(GetProducts.class);
    private RequirementDAO rd = (RequirementDAO) ServletActionContext.getServletContext().getAttribute("requirementDAO");
    private List<Requirements> requirements;

    public List<Requirements> getRequirements() {
        return requirements;
    }

    @Action(value = "/get-requirements", results = {
        @Result(name = "success", location = "../../loanapplication.jsp")
    })
    public String getProductsList() {
        try {
            requirements = rd.getActiveRequirements();
           
            return SUCCESS;

        } catch (Exception e) {
            
        }
        return SUCCESS;
    }
}
